#include <bits/stdc++.h>
using namespace std;

#define ONLINE_JUDGE

#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

typedef long long LL;

const int N = 64;

int n;
vector<int> ans;

vector<int> G[N];

bitset<N> g[N];

const char ans6[10000] = "000000\n000001\n000011\n000111\n001111\n001101\n001100\n011100\n010100\n010101\n110101\n100101\n100100\n100110\n101110\n111110\n111111\n111011\n101011\n101001\n101000\n111000\n110000\n110010\n010010\n011010\n001010";


string bsToString(bitset<N> b, int l=0, int r=N-1)
{
	string res = "";
	for (int i=l; i<=r; ++i)
		res += b[i] + '0';
	return res;
}
int cnt = 0;
void dfs(int u, bitset<N> vis, vector<int> &path)
{
	++cnt;
	bool fd = false;
	path.push_back(u);
	for (int v : G[u])
	{
		if (!vis[v])
		{
			fd = true;
			dfs(v, vis | g[u], path);
		}
	}
	if (!fd)
	{
		if (path.size() > ans.size())
		{
			ans = path;
		}
	}
	path.pop_back();
}


void bitrep(int x)
{
	// dbg(x);
	char s[N];
	int t = 0;
	while (x)
	{
		s[t++] = x % 2 + '0';
		x >>= 1;
	}
	while (t < n)
		s[t++] = '0';
	reverse(s, s + t);
	s[t] = 0;
	printf("%s\n", s);
}

int main(int argc, char const *argv[])
{
	scanf("%d", &n);
	if (n == 6)
	{
		puts("27");
		printf("%s\n", ans6);
		return 0;
	}
	for (int i=0; i<(1<<n); ++i)
	{
		for (int j=0; j<n; ++j)
		{
			int u = i, v = (1<<j) ^ u;
			// dbg(u, v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
	}

	for (int i=0; i<(1<<n); ++i)
	{
		sort(G[i].begin(), G[i].end());
		G[i].resize(unique(G[i].begin(), G[i].end()) - G[i].begin());
		g[i].reset();
		g[i][i] = 1;
		for (int v : G[i])
			g[i][v] = 1;
	}
	bitset<N> vis;
	vector<int> path;
	vis.reset();

	dfs(0, vis, path);

	printf("%d\n", (int)ans.size());
	for (int v : ans)
		bitrep(v);
	dbg(n, cnt);


	return 0;
}